/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainMenu.java
 *
 * Created on 14 mars 2012, 19:32:28
 */
package kuti.grp5.ui;

import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author Jocelyn
 */
public class MainMenu extends javax.swing.JFrame {

    /**
     * Constructor of the main menu
     * Sets the LookAndFeel to Nimbus
     * Works only with JDK 1.6.
     * To make it work with JDK 1.7, juste remake the imports with the auto-import.
     */
    public MainMenu() {
        try {
            UIManager.setLookAndFeel(new NimbusLookAndFeel());
        } catch (UnsupportedLookAndFeelException ex) {
            Logger.getLogger(MainMenu.class.getName()).log(Level.SEVERE, null, ex);
        }   
        initComponents();
        setLocationRelativeTo(this);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pMain = new javax.swing.JPanel();
        imgKuti = new javax.swing.JLabel();
        pBts = new javax.swing.JPanel();
        btNewSimul = new javax.swing.JButton();
        btHisto = new javax.swing.JButton();
        labCreators = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Kuti - Groupe 5");
        setBackground(new java.awt.Color(47, 167, 59));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setMinimumSize(new java.awt.Dimension(909, 484));
        setResizable(false);

        pMain.setBackground(new java.awt.Color(47, 167, 59));
        pMain.setMinimumSize(new java.awt.Dimension(909, 484));

        imgKuti.setIcon(new javax.swing.ImageIcon(getClass().getResource("/kuti/grp5/ui/resources/menu_kuti.jpg"))); // NOI18N

        pBts.setBackground(new java.awt.Color(150, 200, 89));
        pBts.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        pBts.setMinimumSize(new java.awt.Dimension(0, 0));

        btNewSimul.setText("Nouvelle partie");
        btNewSimul.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btNewSimulActionPerformed(evt);
            }
        });

        btHisto.setText("Panthéon");
        btHisto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btHistoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pBtsLayout = new javax.swing.GroupLayout(pBts);
        pBts.setLayout(pBtsLayout);
        pBtsLayout.setHorizontalGroup(
            pBtsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pBtsLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btNewSimul, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(btHisto, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        pBtsLayout.setVerticalGroup(
            pBtsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pBtsLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pBtsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btHisto, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btNewSimul, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        labCreators.setFont(new java.awt.Font("Tahoma", 1, 11));
        labCreators.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labCreators.setText("P.Tinguely - J.Sifringer - V.Do - M. Schorderet - J.Renevey");

        javax.swing.GroupLayout pMainLayout = new javax.swing.GroupLayout(pMain);
        pMain.setLayout(pMainLayout);
        pMainLayout.setHorizontalGroup(
            pMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pMainLayout.createSequentialGroup()
                .addGap(243, 243, 243)
                .addComponent(imgKuti)
                .addContainerGap(220, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pMainLayout.createSequentialGroup()
                .addGap(220, 220, 220)
                .addComponent(pBts, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(206, 206, 206))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pMainLayout.createSequentialGroup()
                .addContainerGap(316, Short.MAX_VALUE)
                .addComponent(labCreators)
                .addGap(274, 274, 274))
        );
        pMainLayout.setVerticalGroup(
            pMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pMainLayout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addComponent(imgKuti)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pBts, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(labCreators)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        getContentPane().add(pMain, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Event triggered when "Nouvelle simulation" button is pressed.
     * Launches the ParamPanel.
     * @param evt ActionEvent triggered
     */
    private void btNewSimulActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btNewSimulActionPerformed
        new ParamPanel(this);
    }//GEN-LAST:event_btNewSimulActionPerformed

    /**
     * Event triggered when "Historique" button is pressed.
     * Launches the History panel.
     * @param evt  Action event triggered
     */
    private void btHistoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btHistoActionPerformed
        new Historique(this);
    }//GEN-LAST:event_btHistoActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btHisto;
    private javax.swing.JButton btNewSimul;
    private javax.swing.JLabel imgKuti;
    private javax.swing.JLabel labCreators;
    private javax.swing.JPanel pBts;
    private javax.swing.JPanel pMain;
    // End of variables declaration//GEN-END:variables
}
